package com.wenhai.concurrency.thread.pool;

import java.util.concurrent.Callable;

/**
 * @ClassName MyCallableA
 * @Description
 * @Author 谢文海
 * @Date 2021/4/27 0:41
 * @Version 1.0
 **/
public class MyCallableA implements Callable<String> {
    @Override
    public String call() throws Exception {

        System.out.printf("MyCallableA  %s   begin:%d\n ", Thread.currentThread().getName(), System.currentTimeMillis());
        for (int i = 0; i < 122345; i++) {
            Math.random();
            Math.random();
            Math.random();
//            System.out.println("MyCallableA 在运行总 = " + (i + 1));
        }
//        if (true) {
//            System.out.println("xxxxxxx=中断了");
//            throw new NullPointerException();
//        }
        System.out.printf("MyCallableA  %s   end:%d \n", Thread.currentThread().getName(), System.currentTimeMillis());
        return "Return A";
    }
}
